import {createApp, DirectiveBinding} from 'vue'
import App from './App.vue'
import Antd from 'ant-design-vue'
import router from './router'
import store from './store/index'
import 'ant-design-vue/dist/antd.css'
import jshint from 'jshint'
import 'codemirror/lib/codemirror.css'
import 'highlight.js/styles/github.css'
import './assets/scss/common.scss'
import './assets/scss/contractInfo.scss'
import api from '@/api'
import {validator} from '@/utils/validator'
import Directives from '@/utils/directives.js'
import * as echarts from "echarts"
import * as Icons from '@ant-design/icons-vue'
import jquery from "jquery"
import preventReClick from "@/utils/preventReClick";
let app = createApp(App)
app.config.productionTip = false
app.config.globalProperties.$api = api
app.config.globalProperties.$validator = validator
app.config.globalProperties.$echarts = echarts
app.config.globalProperties.$icons = Icons
window.JSHINT = jshint.JSHINT

// const debounce = (callback, delay) => {
//     let tid
//     return function () {
//         const ctx = self
//         tid && clearTimeout(tid);
//         tid = setTimeout(() => {
//             callback.apply(ctx, arguments)
//         }, delay)
//     }
// }
//
// export default () => {
//     const _ = window.ResizeObserver;
//     window.ResizeObserver = class ResizeObserver extends _ {
//         constructor(callback) {
//             callback = debounce(callback, 20)
//             super(callback);
//         }
//     }
// }
// window.ResizeObserver = class _NewResizeObserver extends ResizeObserver {
//     constructor(callback) {
//         super(() => window.requestAnimationFrame(() => callback.apply(this, arguments)));
//     }
// }

app.use(Antd)
app.use(router)
app.use(store)
app.use(Directives)
app.use(jquery)
app.use(preventReClick)
app.mount('#app')
